package com.blog.web.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.blog.web.bean.Album;
import com.blog.web.dao.PictureMapper;
import com.blog.web.service.PictureService;

@Service
public class PictureServiceImpl implements PictureService
{
	@Resource
	PictureMapper pictureMapper;
	
	public Integer addOrSaveAlbum(Album album) {
		if(album.getId()==null)
		{
			return	pictureMapper.insertAlbum(album);
		}
		else
		{
			return	pictureMapper.updateAlbumById(album);
		}
	}

	public Album queryAlbumById(Integer id) {
		return pictureMapper.selectAlbumById(id);
	}

	public List<Album> queryAlbumByOption(Map<String, String> map) {
		return pictureMapper.queryAlbumByOption(map);
	}
	
}
